<?php

/**
 * Enter description here ...
 * @author afontalvo
 *
 */
class RealObject implements noTimeDuplicable{

	/**
	 * Enter description here ...
	 * @var WeeklyCalendar
	 */
	private $calendar=null;
	
	/**
	 * Enter description here ...
	 */
	function __construct(){
	 $calendar =new WeeklyCalendar();
	 
	}
	
	/**
	 * Programa una sita para el objecto
	 * @param Int $day
	 * @param Int $hour
	 * @param Int $duration
	 * @throws HourBusyException
	 */
	private function schedule($day,$hour,$duration=1){
	  try{
	   $this->getCalendar()->newAnnotation($day, $hour, $duration);
	  }catch (HourBusyException $e){
	   throw $e;
	  }
	}
	
	/**
	 * Enter description here ...
	 * @return WeeklyCalendar
	 */
	function getCalendar(){
	 return $this->calendar;
	}
	
}